package com.fzh.bookstore.biz.member.controller;


import com.fzh.bookstore.biz.banner.dto.BannerPositionRequest;
import com.fzh.bookstore.biz.member.dto.MemberRequest;
import com.fzh.bookstore.biz.member.dto.RegisterRequest;
import com.fzh.bookstore.biz.member.service.MemberService;
import com.fzh.bookstore.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-02-26
 */
@RestController
@RequestMapping("/member")
@Api(value = "会员模板",tags = {"会员模板"})
public class MemberController {


    @Autowired
    private MemberService memberService;

    @PostMapping("/register")
    @ApiOperation(value = "小程序注册(App)" ,notes = "")
    public SuperResponse register(@Valid @RequestBody RegisterRequest request ){
        return  memberService.register(request);
    }



    @PostMapping("/info")
    @ApiOperation(value = "获取用户信息(App)" ,notes = "")
    public SuperResponse info(@Valid @RequestBody MemberRequest request ){
        return  memberService.findMemberByUid(request);
    }

}

